
package uestc.bitman.edxapp.chapter;

import android.content.Context;
import android.util.AttributeSet;
import android.webkit.WebChromeClient;
import android.webkit.WebResourceResponse;
import android.webkit.WebView;
import android.webkit.WebViewClient;

public class CourseInfoWebView extends WebView {

    public CourseInfoWebView(Context context) {
        super(context);
        init();
    }

    public CourseInfoWebView(Context context, AttributeSet attrs) {
        super(context, attrs);
        init();
    }

    public CourseInfoWebView(Context context, AttributeSet attrs, int defStyle) {
        super(context, attrs, defStyle);
        init();
    }

    private void init() {

        setWebViewClient(new CourseInfoWebviewClient());
        setWebChromeClient(new CourseInfoWebChromeCline());
    }

    class CourseInfoWebviewClient extends WebViewClient {
        public boolean shouldOverrideUrlLoading(WebView view, String url) {
            // Now we just pass the url to the third part downloader
            return true;
        }

        public WebResourceResponse shouldInterceptRequest(WebView view, String url) {
            return super.shouldInterceptRequest(view, url);
        }
    }

    class CourseInfoWebChromeCline extends WebChromeClient {

    }
}
